<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
	.KEYW {color: #933;}
	.COMM {color: #bbb; font-style: italic;}
	.NUMB {color: #393;}
	.STRN {color: #393;}
	.REGX {color: #339;}
	.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
	</style></head><body><pre><span class='line'>  1</span> <span class="COMM">/** 
<span class='line'>  2</span>  * (smt)2 simple mouse tracking - auxiliary functions (smt-aux-2.0.0.js)
<span class='line'>  3</span>  * Copyleft (cc) 2006-2009 Luis Leiva
<span class='line'>  4</span>  * Release date: September 12th 2009
<span class='line'>  5</span>  * http://smt.speedzinemedia.com  
<span class='line'>  6</span>  * @class smt2-aux
<span class='line'>  7</span>  * @version 2.0.0
<span class='line'>  8</span>  * @author Luis Leiva 
<span class='line'>  9</span>  * @license Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. 
<span class='line'> 10</span>  */</span><span class="WHIT">
<span class='line'> 11</span> 
<span class='line'> 12</span> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">smtAuxFn</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 13</span> </span><span class="WHIT">  </span><span class="COMM">/**
<span class='line'> 14</span>    * Overrides (smt) tracking options object with custom-provided options object
<span class='line'> 15</span>    * @return void
<span class='line'> 16</span>    * @param {object} smtOptionsObj
<span class='line'> 17</span>    * @param {object} customOptionsObj
<span class='line'> 18</span>    * @see &lt;code>smtOpt&lt;/code> object either in &lt;code>smtRecord&lt;/code> or &lt;code>smtReplay&lt;/code> classes 
<span class='line'> 19</span>    */</span><span class="WHIT">
<span class='line'> 20</span> </span><span class="WHIT">  </span><span class="NAME">overrideTrackingOptions</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">smtOptionsObj</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">customOptionsObj</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'> 21</span> </span><span class="WHIT">  </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 22</span> </span><span class="WHIT">    </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">prop</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">smtOptionsObj</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 23</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">customOptionsObj.hasOwnProperty</span><span class="PUNC">(</span><span class="NAME">prop</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">customOptionsObj</span><span class="PUNC">[</span><span class="NAME">prop</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 24</span> </span><span class="WHIT">        </span><span class="NAME">smtOptionsObj</span><span class="PUNC">[</span><span class="NAME">prop</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">customOptionsObj</span><span class="PUNC">[</span><span class="NAME">prop</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 25</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 26</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 27</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 28</span> </span><span class="WHIT">  </span><span class="COMM">/**
<span class='line'> 29</span>    * Allows recording/replaying the mouse path over Flash objects.
<span class='line'> 30</span>    * A Flash movie may display above all the layers on the HTML apge, 
<span class='line'> 31</span>    * regardless of the stacking order ("z-index") of those layers.   
<span class='line'> 32</span>    * Using a WMODE value of "opaque" or "transparent" will prevent a Flash movie from playing in the topmost layer 
<span class='line'> 33</span>    * and allow you to adjust the layering of the movie within other layers of the HTML document.
<span class='line'> 34</span>    * However, to avoid possible performance issues, it's best use the "opaque" mode.   
<span class='line'> 35</span>    * Note: The WMODE parameter is supported only on some browser/Flash Player version combinations. 
<span class='line'> 36</span>    * If the WMODE parameter is not supported, the Flash movie will always display on top.
<span class='line'> 37</span>    * @return void  
<span class='line'> 38</span>    */</span><span class="WHIT">
<span class='line'> 39</span> </span><span class="WHIT">  </span><span class="NAME">allowTrackingOnFlashObjects</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 40</span> </span><span class="WHIT">  </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 41</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">obj</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">document.getElementsByTagName</span><span class="PUNC">(</span><span class="STRN">"object"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">  </span><span class="WHIT">
<span class='line'> 42</span> </span><span class="WHIT">    </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">t</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">obj.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">t</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">++</span><span class="NAME">i</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 43</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">param</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">document.createElement</span><span class="PUNC">(</span><span class="STRN">"param"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 44</span> </span><span class="WHIT">      </span><span class="NAME">param.setAttribute</span><span class="PUNC">(</span><span class="STRN">"name"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"wmode"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 45</span> </span><span class="WHIT">      </span><span class="NAME">param.setAttribute</span><span class="PUNC">(</span><span class="STRN">"value"</span><span class="PUNC">,</span><span class="STRN">"opaque"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 46</span> </span><span class="WHIT">      </span><span class="NAME">obj</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">appendChild</span><span class="PUNC">(</span><span class="NAME">param</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 47</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 48</span> </span><span class="WHIT">    </span><span class="WHIT">
<span class='line'> 49</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">embed</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">document.getElementsByTagName</span><span class="PUNC">(</span><span class="STRN">"embed"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 50</span> </span><span class="WHIT">    </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">j</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">u</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">embed.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">j</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">u</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">++</span><span class="NAME">j</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 51</span> </span><span class="WHIT">      </span><span class="NAME">embed</span><span class="PUNC">[</span><span class="NAME">j</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">setAttribute</span><span class="PUNC">(</span><span class="STRN">"wmode"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"opaque"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 52</span> </span><span class="WHIT">      </span><span class="COMM">// recording on some browsers is tricky (replaying is ok, though)</span><span class="WHIT">
<span class='line'> 53</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="REGX">/MSIE/i</span><span class="PUNC">.</span><span class="NAME">test</span><span class="PUNC">(</span><span class="NAME">navigator.userAgent</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 54</span> </span><span class="WHIT">        </span><span class="COMM">/* Some browsers sets the wmode correctly, 
<span class='line'> 55</span>          * but once the SWF object is instantiated you can't update its properties.
<span class='line'> 56</span>          * So, replace the old Flash object with the new one ;)       
<span class='line'> 57</span>          */</span><span class="WHIT">
<span class='line'> 58</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">cloned</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">embed</span><span class="PUNC">[</span><span class="NAME">j</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">cloneNode</span><span class="PUNC">(</span><span class="KEYW">true</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 59</span> </span><span class="WHIT">        </span><span class="NAME">embed</span><span class="PUNC">[</span><span class="NAME">j</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">parentNode.replaceChild</span><span class="PUNC">(</span><span class="NAME">cloned</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">embed</span><span class="PUNC">[</span><span class="NAME">j</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 60</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 61</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 62</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 63</span> </span><span class="WHIT">  </span><span class="COMM">/**
<span class='line'> 64</span>    * Traces a message in the debug console, if available. 
<span class='line'> 65</span>    * @return void
<span class='line'> 66</span>    * @param {string} type   message type: "log" (default), "info", or "error"
<span class='line'> 67</span>    * @param {mixed}  msg    message text (anything to trace)
<span class='line'> 68</span>    */</span><span class="WHIT">
<span class='line'> 69</span> </span><span class="WHIT">  </span><span class="NAME">log</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">msg</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">type</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 70</span> </span><span class="WHIT">  </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 71</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">type</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">type</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"log"</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 72</span> </span><span class="WHIT">    </span><span class="COMM">// check if console is available</span><span class="WHIT">
<span class='line'> 73</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">window.console</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 74</span> </span><span class="WHIT">    </span><span class="COMM">// display messages in the console</span><span class="WHIT">
<span class='line'> 75</span> </span><span class="WHIT">    </span><span class="KEYW">switch</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">type</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 76</span> </span><span class="WHIT">      </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="STRN">'log'</span><span class="PUNC">:</span><span class="WHIT">
<span class='line'> 77</span> </span><span class="WHIT">        </span><span class="NAME">console.log</span><span class="PUNC">(</span><span class="NAME">msg</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 78</span> </span><span class="WHIT">        </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 79</span> </span><span class="WHIT">      </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="STRN">'info'</span><span class="PUNC">:</span><span class="WHIT">
<span class='line'> 80</span> </span><span class="WHIT">        </span><span class="NAME">console.info</span><span class="PUNC">(</span><span class="NAME">msg</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 81</span> </span><span class="WHIT">        </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 82</span> </span><span class="WHIT">      </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="STRN">'error'</span><span class="PUNC">:</span><span class="WHIT">
<span class='line'> 83</span> </span><span class="WHIT">        </span><span class="NAME">console.error</span><span class="PUNC">(</span><span class="NAME">msg</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 84</span> </span><span class="WHIT">        </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 85</span> </span><span class="WHIT">      </span><span class="KEYW">default</span><span class="PUNC">:</span><span class="WHIT">
<span class='line'> 86</span> </span><span class="WHIT">        </span><span class="NAME">console.log</span><span class="PUNC">(</span><span class="NAME">msg</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 87</span> </span><span class="WHIT">        </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 88</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 89</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 90</span> </span><span class="WHIT">  </span><span class="COMM">/**
<span class='line'> 91</span>    * Checks the DOM-ready initialization in modern browsers.
<span class='line'> 92</span>    * This method was introduced by Dean Edwards/Matthias Miller/John Resig (dean.edwards.name/outofhanwell.com/jquery.com)
<span class='line'> 93</span>    * and it is discussed in http://dean.edwards.name/weblog/2006/06/again/
<span class='line'> 94</span>    * It's 2009, and fortunately nowadays there are only 2 types of modern browsers: W3C standards and Internet Explorer.  
<span class='line'> 95</span>    * @return void
<span class='line'> 96</span>    * @param {function} callback   the function to be called on DOM load
<span class='line'> 97</span>    */</span><span class="WHIT">
<span class='line'> 98</span> </span><span class="WHIT">  </span><span class="NAME">onDOMload</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">callback</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 99</span> </span><span class="WHIT">  </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>100</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">arguments.callee.done</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>101</span> </span><span class="WHIT">    </span><span class="COMM">// flag this function so we don't do the same thing twice</span><span class="WHIT">
<span class='line'>102</span> </span><span class="WHIT">    </span><span class="NAME">arguments.callee.done</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>103</span> </span><span class="WHIT">    </span><span class="WHIT">
<span class='line'>104</span> </span><span class="WHIT">    </span><span class="COMM">// Firefox, Opera, Webkit-based browsers (Chrome, Safari)...</span><span class="WHIT">
<span class='line'>105</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">document.addEventListener</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>106</span> </span><span class="WHIT">      </span><span class="NAME">document.addEventListener</span><span class="PUNC">(</span><span class="STRN">'DOMContentLoaded'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>107</span> </span><span class="WHIT">      </span><span class="NAME">document.removeEventListener</span><span class="PUNC">(</span><span class="STRN">'DOMContentLoaded'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>108</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>109</span> </span><span class="WHIT">    </span><span class="COMM">// Internet Explorer ¬¬</span><span class="WHIT">
<span class='line'>110</span> </span><span class="WHIT">    </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">document.attachEvent</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>111</span> </span><span class="WHIT">      </span><span class="KEYW">try</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>112</span> </span><span class="WHIT">        </span><span class="NAME">document.write</span><span class="PUNC">(</span><span class="STRN">"&lt;scr"</span><span class="PUNC">+</span><span class="STRN">"ipt id=__ie_onload defer=true src=//:>&lt;\/scr"</span><span class="PUNC">+</span><span class="STRN">"ipt>"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>113</span> </span><span class="WHIT">      	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">script</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">document.getElementById</span><span class="PUNC">(</span><span class="STRN">"__ie_onload"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'>114</span> </span><span class="WHIT">      	</span><span class="NAME">script.onreadystatechange</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>115</span> </span><span class="WHIT">          </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.readyState</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">'complete'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>116</span> </span><span class="WHIT">      	</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>117</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">catch</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>118</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>119</span> </span><span class="WHIT">    </span><span class="COMM">// fallback: old browsers use the window.onload event</span><span class="WHIT">
<span class='line'>120</span> </span><span class="WHIT">    </span><span class="NAME">this.addEvent</span><span class="PUNC">(</span><span class="NAME">window</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'load'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>121</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>122</span> </span><span class="WHIT">  </span><span class="COMM">/**
<span class='line'>123</span>    * Loads more mouse trails for the current user, if available.
<span class='line'>124</span>    * @return void
<span class='line'>125</span>    * @param {object}   smtData    The user's data object
<span class='line'>126</span>    */</span><span class="WHIT">
<span class='line'>127</span> </span><span class="WHIT">  </span><span class="NAME">loadNextMouseTrail</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">smtData</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'>128</span> </span><span class="WHIT">  </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>129</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">smtData.api</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">'undefined'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">smtData.api</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"js"</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>130</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">currTrailPos</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.array.indexOf</span><span class="PUNC">(</span><span class="NAME">smtData.trails</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">smtData.currtrail</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>131</span> </span><span class="WHIT">    </span><span class="COMM">// check</span><span class="WHIT">
<span class='line'>132</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">currTrailPos</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">smtData.trails.length</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>133</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">navigateTo</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">smtData.trailurl</span><span class="PUNC">+</span><span class="STRN">'?id='</span><span class="PUNC">+</span><span class="NAME">smtData.trails</span><span class="PUNC">[</span><span class="NAME">currTrailPos</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">+</span><span class="STRN">'&api='</span><span class="PUNC">+</span><span class="NAME">smtData.api</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>134</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">smtData.autoload</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>135</span> </span><span class="WHIT">        </span><span class="NAME">window.location.href</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">navigateTo</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>136</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">confirm</span><span class="PUNC">(</span><span class="STRN">"This user also browsed more pages.\nDo you want to replay the next log?"</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>137</span> </span><span class="WHIT">        </span><span class="NAME">window.location.href</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">navigateTo</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>138</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>139</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>140</span> </span><span class="WHIT">      </span><span class="NAME">alert</span><span class="PUNC">(</span><span class="STRN">"There are no more browsed pages for this user."</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>141</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>142</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'>143</span> </span><span class="WHIT">  </span><span class="COMM">/**
<span class='line'>144</span>    * Gets the browser's window size (aka 'the viewport').     
<span class='line'>145</span>    * @return {object} window dimmensions - object with 2 properties: width {integer}, and height {integer}
<span class='line'>146</span>    */</span><span class="WHIT">
<span class='line'>147</span> </span><span class="WHIT">  </span><span class="NAME">getWindowSize</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'>148</span> </span><span class="WHIT">  </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>149</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">d</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">document</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>150</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">w</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">window.innerWidth</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">window.innerWidth</span><span class="WHIT">
<span class='line'>151</span> </span><span class="WHIT">          	</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">d.documentElement</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">d.documentElement.clientWidth</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">d.documentElement.clientWidth</span><span class="WHIT">
<span class='line'>152</span> </span><span class="WHIT">          	</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">d.body</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">d.body.clientWidth</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">d.body.clientWidth</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'>153</span> </span><span class="WHIT">            </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>154</span> </span><span class="WHIT">  	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">h</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">window.innerHeight</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">window.innerHeight</span><span class="WHIT">
<span class='line'>155</span> </span><span class="WHIT">          	</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">d.documentElement</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">d.documentElement.clientHeight</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">d.documentElement.clientHeight</span><span class="WHIT">
<span class='line'>156</span> </span><span class="WHIT">          	</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">d.body</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">d.body.clientHeight</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">d.body.clientHeight</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'>157</span> </span><span class="WHIT">            </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>158</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">width</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">w</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">height</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">h</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>159</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>160</span> </span><span class="WHIT">  </span><span class="COMM">/**
<span class='line'>161</span>    * Gets the browser window's offsets.
<span class='line'>162</span>    * @return {object} window offsets - object with 2 properties: x {integer}, and y {integer}
<span class='line'>163</span>    * @deprecated     
<span class='line'>164</span>    */</span><span class="WHIT">
<span class='line'>165</span> </span><span class="WHIT">  </span><span class="NAME">getWindowOffset</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>166</span> </span><span class="WHIT">  </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>167</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">d</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">document</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>168</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">xpos</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">window.pageXOffset</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">window.pageXOffset</span><span class="WHIT">
<span class='line'>169</span> </span><span class="WHIT">            	 </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">d.documentElement</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">d.documentElement.scrollLeft</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">d.documentElement.scrollLeft</span><span class="WHIT">
<span class='line'>170</span> </span><span class="WHIT">            	 </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">d.body</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">d.body.scrollLeft</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">d.body.scrollLeft</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'>171</span> </span><span class="WHIT">               </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>172</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">ypos</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">window.pageYOffset</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">window.pageYOffset</span><span class="WHIT">
<span class='line'>173</span> </span><span class="WHIT">            	 </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">d.documentElement</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">d.documentElement.scrollTop</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">d.documentElement.scrollTop</span><span class="WHIT">
<span class='line'>174</span> </span><span class="WHIT">            	 </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">d.body</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">d.body.scrollTop</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">d.body.scrollTop</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'>175</span> </span><span class="WHIT">               </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>176</span> </span><span class="WHIT">    </span><span class="WHIT">
<span class='line'>177</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">x</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">xpos</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">y</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">ypos</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>178</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>179</span> </span><span class="WHIT">  </span><span class="COMM">/**
<span class='line'>180</span>    * Gets the document's size.       
<span class='line'>181</span>    * @return {object} document dimmensions - object with 2 properties: width {integer}, and height {integer}  
<span class='line'>182</span>    */</span><span class="WHIT">
<span class='line'>183</span> </span><span class="WHIT">  </span><span class="NAME">getDocumentSize</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'>184</span> </span><span class="WHIT">  </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>185</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">d</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">document</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>186</span> </span><span class="WHIT">  	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">w</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">window.innerWidth</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">window.scrollMaxX</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">window.innerWidth</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">window.scrollMaxX</span><span class="WHIT">
<span class='line'>187</span> </span><span class="WHIT">          	</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">d.body</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">d.body.scrollWidth</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NAME">d.body.offsetWidth</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">d.body.scrollWidth</span><span class="WHIT">
<span class='line'>188</span> </span><span class="WHIT">          	</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">d.body</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">d.body.offsetWidth</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">d.body.offsetWidth</span><span class="WHIT">
<span class='line'>189</span> </span><span class="WHIT">            </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>190</span> </span><span class="WHIT">  	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">h</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">window.innerHeight</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">window.scrollMaxY</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">window.innerHeight</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">window.scrollMaxY</span><span class="WHIT">
<span class='line'>191</span> </span><span class="WHIT">          	</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">d.body</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">d.body.scrollHeight</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NAME">d.body.offsetHeight</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">d.body.scrollHeight</span><span class="WHIT">
<span class='line'>192</span> </span><span class="WHIT">          	</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">d.body</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">d.body.offsetHeight</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">d.body.offsetHeight</span><span class="WHIT">
<span class='line'>193</span> </span><span class="WHIT">            </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>194</span> </span><span class="WHIT">    	</span><span class="WHIT">
<span class='line'>195</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">width</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">w</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">height</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">h</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>196</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>197</span> </span><span class="WHIT">  </span><span class="COMM">/**
<span class='line'>198</span>    * Gets the max value from both window (viewport's size) and document's size, adding offsets.
<span class='line'>199</span>    * MSHTML (Trident), Firefox (Gecko), Opera (Presto), and Safari (Webkit) support offsetHeight on document.body or on document.documentElement. 
<span class='line'>200</span>    * The difficulty is figuring out which one is reliable, because it depends on the environment. 
<span class='line'>201</span>    * As usual, the environment includes the browser, its version, and the rendering mode of the document.     
<span class='line'>202</span>    * @return {object} viewport dimmensions object with 2 properties: width {integer}, and height {integer}  
<span class='line'>203</span>    */</span><span class="WHIT">
<span class='line'>204</span> </span><span class="WHIT">  </span><span class="NAME">getPageSize</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>205</span> </span><span class="WHIT">  </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>206</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">win</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.getWindowSize</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>207</span> </span><span class="WHIT">        </span><span class="NAME">doc</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.getDocumentSize</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>208</span> 
<span class='line'>209</span> </span><span class="WHIT">    </span><span class="COMM">// find max values from this group</span><span class="WHIT">
<span class='line'>210</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">w</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">doc.width</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">win.width</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">win.width</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">doc.width</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>211</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">h</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">doc.height</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">win.height</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">win.height</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">doc.height</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>212</span> </span><span class="WHIT">    </span><span class="COMM">// however, some browsers in some situations should return more space available</span><span class="WHIT">
<span class='line'>213</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">d</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">document.documentElement</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">document.body</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>214</span> </span><span class="WHIT">    </span><span class="COMM">// verify offsets...</span><span class="WHIT">
<span class='line'>215</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">h</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">d.offsetHeight</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">h</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">d.offsetHeight</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>216</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">w</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">d.offsetWidth</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">w</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">d.offsetWidth</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>217</span> </span><span class="WHIT">    </span><span class="COMM">// ...and scrolls</span><span class="WHIT">
<span class='line'>218</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">h</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">d.scrollHeight</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">h</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">d.scrollHeight</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>219</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">w</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">d.scrollWidth</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">w</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">d.scrollWidth</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>220</span> 
<span class='line'>221</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">width</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">w</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">height</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">h</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>222</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>223</span> </span><span class="WHIT">  </span><span class="COMM">/**
<span class='line'>224</span>    * Failsafe function. If your pages' HTML code does not allocate the image's dimensions (width/height attributes),
<span class='line'>225</span>    * then the page size will not be accurately computed and the tracking layer can be cropped.
<span class='line'>226</span>    * This occurs sometimes due to the replaying script begins on DOM load.   
<span class='line'>227</span>    * @return {object} viewport dimmensions object with 2 properties: width {integer}, and height {integer}  
<span class='line'>228</span>    */</span><span class="WHIT">
<span class='line'>229</span> </span><span class="WHIT">  </span><span class="NAME">getHardcorePageSize</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>230</span> </span><span class="WHIT">  </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>231</span> </span><span class="WHIT">    </span><span class="COMM">// let's define some helpers</span><span class="WHIT">
<span class='line'>232</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">w1</span><span class="PUNC">=</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">h1</span><span class="PUNC">=</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">w2</span><span class="PUNC">=</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">h2</span><span class="PUNC">=</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">w3</span><span class="PUNC">=</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">h3</span><span class="PUNC">=</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">w4</span><span class="PUNC">=</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">h4</span><span class="PUNC">=</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>233</span> </span><span class="WHIT">        </span><span class="NAME">de</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">document.documentElement</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>234</span> </span><span class="WHIT">        </span><span class="NAME">db</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">document.body</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>235</span> </span><span class="WHIT">  </span><span class="WHIT">
<span class='line'>236</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">window.innerHeight</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>237</span> </span><span class="WHIT">  		</span><span class="NAME">w1</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">window.innerWidth</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>238</span> </span><span class="WHIT">  		</span><span class="NAME">h1</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">window.innerHeight</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>239</span> </span><span class="WHIT">  		</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">window.scrollMaxY</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>240</span> </span><span class="WHIT">  		  </span><span class="NAME">w1</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">window.scrollMaxY</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>241</span> </span><span class="WHIT">  		  </span><span class="NAME">h1</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">window.scrollMaxY</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>242</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>243</span> </span><span class="WHIT">  	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>244</span> </span><span class="WHIT">  	</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">de.offsetHeight</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>245</span> </span><span class="WHIT">      </span><span class="NAME">w2</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">de.offsetWidth</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>246</span> </span><span class="WHIT">      </span><span class="NAME">h2</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">de.offsetHeight</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>247</span> </span><span class="WHIT">  	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>248</span> </span><span class="WHIT">  	</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">db.scrollHeight</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>249</span> </span><span class="WHIT">  		</span><span class="NAME">w3</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">db.scrollWidth</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>250</span> </span><span class="WHIT">  		</span><span class="NAME">h3</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">db.scrollHeight</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>251</span> </span><span class="WHIT">  	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>252</span> </span><span class="WHIT">  	</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">db.offsetWidth</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>253</span> </span><span class="WHIT">      </span><span class="NAME">w4</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">db.offsetWidth</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>254</span> </span><span class="WHIT">      </span><span class="NAME">h4</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">db.offsetHeight</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>255</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">db.offsetLeft</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>256</span> </span><span class="WHIT">        </span><span class="NAME">w4</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">db.offsetLeft</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>257</span> </span><span class="WHIT">        </span><span class="NAME">h4</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">db.offsetTop</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>258</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>259</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>260</span> </span><span class="WHIT">    </span><span class="COMM">// now return the max value</span><span class="WHIT">
<span class='line'>261</span> </span><span class="WHIT">  	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">maxHeight</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Math.max</span><span class="PUNC">(</span><span class="NAME">h1</span><span class="PUNC">,</span><span class="NAME">h2</span><span class="PUNC">,</span><span class="NAME">h3</span><span class="PUNC">,</span><span class="NAME">h4</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>262</span> </span><span class="WHIT">  	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">maxWidth</span><span class="WHIT">  </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Math.max</span><span class="PUNC">(</span><span class="NAME">w1</span><span class="PUNC">,</span><span class="NAME">w2</span><span class="PUNC">,</span><span class="NAME">w3</span><span class="PUNC">,</span><span class="NAME">w4</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>263</span> </span><span class="WHIT">  	</span><span class="WHIT">
<span class='line'>264</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">width</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">maxWidth</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">height</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">maxHeight</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>265</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>266</span> </span><span class="WHIT">  </span><span class="COMM">/**
<span class='line'>267</span>    * Gets the max z-index level available on the page.
<span class='line'>268</span>    * @return {integer}    z-index level     
<span class='line'>269</span>    * @param {object} e    DOM element (default: document)
<span class='line'>270</span>    * @autor Jason J. Jaeger (greengeckodesign.com)   
<span class='line'>271</span>    */</span><span class="WHIT">
<span class='line'>272</span> </span><span class="WHIT">  </span><span class="NAME">getNextHighestDepth</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'>273</span> </span><span class="WHIT">  </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>274</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">highestIndex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>275</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">currentIndex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>276</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">elementArray</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>277</span> </span><span class="WHIT">    </span><span class="COMM">// check all elements in page ...</span><span class="WHIT">
<span class='line'>278</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">document.getElementsByTagName</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>279</span> </span><span class="WHIT">      </span><span class="NAME">elementArray</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">document.getElementsByTagName</span><span class="PUNC">(</span><span class="STRN">'*'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>280</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">e.getElementsByTagName</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>281</span> </span><span class="WHIT">      </span><span class="NAME">elementArray</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">document.getElementsByTagName</span><span class="PUNC">(</span><span class="STRN">'*'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>282</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>283</span> </span><span class="WHIT">    </span><span class="COMM">// ... and iterate</span><span class="WHIT">
<span class='line'>284</span> </span><span class="WHIT">    </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">l</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">elementArray.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">l</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">++</span><span class="NAME">i</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>285</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">elementArray</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">currentStyle</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>286</span> </span><span class="WHIT">        </span><span class="NAME">currentIndex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">parseFloat</span><span class="PUNC">(</span><span class="NAME">elementArray</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">currentStyle.zIndex</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>287</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">window.getComputedStyle</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>288</span> </span><span class="WHIT">        </span><span class="NAME">currentIndex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">parseFloat</span><span class="PUNC">(</span><span class="NAME">document.defaultView.getComputedStyle</span><span class="PUNC">(</span><span class="NAME">elementArray</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="KEYW">null</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">getPropertyValue</span><span class="PUNC">(</span><span class="STRN">'z-index'</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>289</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>290</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">currentIndex</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NAME">highestIndex</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">highestIndex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">currentIndex</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>291</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>292</span> 
<span class='line'>293</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">highestIndex</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>294</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>295</span> </span><span class="WHIT">  </span><span class="COMM">/**
<span class='line'>296</span>    * Adds event listeners unobtrusively.
<span class='line'>297</span>    * @return void     
<span class='line'>298</span>    * @param {object}    obj   Object to add listener(s) to
<span class='line'>299</span>    * @param {string}    type  Event type
<span class='line'>300</span>    * @param {function}  fn    Function to execute
<span class='line'>301</span>    * @autor John Resig (jquery.com)   
<span class='line'>302</span>    */</span><span class="WHIT">
<span class='line'>303</span> </span><span class="WHIT">  </span><span class="NAME">addEvent</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">obj</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">type</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">fn</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'>304</span> </span><span class="WHIT">  </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>305</span> </span><span class="WHIT">  	</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">obj.addEventListener</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>306</span> </span><span class="WHIT">      </span><span class="NAME">obj.addEventListener</span><span class="PUNC">(</span><span class="NAME">type</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">fn</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>307</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">obj.attachEvent</span><span class="PUNC">)</span><span class="WHIT">	</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>308</span> </span><span class="WHIT">  		</span><span class="NAME">obj</span><span class="PUNC">[</span><span class="STRN">"e"</span><span class="PUNC">+</span><span class="NAME">type</span><span class="PUNC">+</span><span class="NAME">fn</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">fn</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>309</span> </span><span class="WHIT">  		</span><span class="NAME">obj</span><span class="PUNC">[</span><span class="NAME">type</span><span class="PUNC">+</span><span class="NAME">fn</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">obj</span><span class="PUNC">[</span><span class="STRN">"e"</span><span class="PUNC">+</span><span class="NAME">type</span><span class="PUNC">+</span><span class="NAME">fn</span><span class="PUNC">]</span><span class="PUNC">(</span><span class="NAME">window.event</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>310</span> </span><span class="WHIT">  		</span><span class="NAME">obj.attachEvent</span><span class="PUNC">(</span><span class="STRN">"on"</span><span class="PUNC">+</span><span class="NAME">type</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">obj</span><span class="PUNC">[</span><span class="NAME">type</span><span class="PUNC">+</span><span class="NAME">fn</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>311</span> </span><span class="WHIT">  	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>312</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>313</span> </span><span class="WHIT">  </span><span class="COMM">/**
<span class='line'>314</span>    * Rounds a number to a given digits accuracy.
<span class='line'>315</span>    * @return {float}
<span class='line'>316</span>    * @param {float}   number  input number
<span class='line'>317</span>    * @param {integer} digits  precision digits
<span class='line'>318</span>    */</span><span class="WHIT">
<span class='line'>319</span> </span><span class="WHIT">  </span><span class="NAME">roundTo</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">number</span><span class="PUNC">,</span><span class="NAME">digits</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>320</span> </span><span class="WHIT">  </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>321</span> </span><span class="WHIT">    </span><span class="COMM">//if (!digits) { digits = 2; }</span><span class="WHIT">
<span class='line'>322</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">exp</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">100</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">// faster, because (smt)2 precision is the same for all computations!</span><span class="WHIT">
<span class='line'>323</span> </span><span class="WHIT">    </span><span class="COMM">/* in 'taliban mode' that would be ok:
<span class='line'>324</span>      * &lt;code>var exp = Math.pow(10,digits);&lt;/code>
<span class='line'>325</span>      * or even this, avoiding the pow function:
<span class='line'>326</span>      * &lt;code>for (var i = 0, exp = 1; i &lt; digits.length; ++i, exp *= 10) {}&lt;/code>          
<span class='line'>327</span>      */</span><span class="WHIT">
<span class='line'>328</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">Math.round</span><span class="PUNC">(</span><span class="NAME">exp</span><span class="PUNC">*</span><span class="NAME">number</span><span class="PUNC">)</span><span class="PUNC">/</span><span class="NAME">exp</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'>329</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>330</span> </span><span class="WHIT">  </span><span class="COMM">/**
<span class='line'>331</span>    * Scrolls the browser window.
<span class='line'>332</span>    * This function is quite useful for replaying the user trails comfortably ;)   
<span class='line'>333</span>    * @return void
<span class='line'>334</span>    * @param {object}   obj    Config object
<span class='line'>335</span>    * @config {integer} xpos   X coordinate
<span class='line'>336</span>    * @config {integer} ypos   Y coordinate
<span class='line'>337</span>    * @config {integer} width  Viewport width
<span class='line'>338</span>    * @config {integer} height Viewport height
<span class='line'>339</span>    */</span><span class="WHIT">
<span class='line'>340</span> </span><span class="WHIT">  </span><span class="NAME">doScroll</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">obj</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>341</span> </span><span class="WHIT">  </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>342</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">off</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.getWindowOffset</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>343</span> </span><span class="WHIT">    </span><span class="COMM">// center current mouse coords on the viewport</span><span class="WHIT">
<span class='line'>344</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">xto</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Math.round</span><span class="PUNC">(</span><span class="NAME">obj.xpos</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">obj.width</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">obj.width</span><span class="PUNC">/</span><span class="NUMB">2</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>345</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">yto</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Math.round</span><span class="PUNC">(</span><span class="NAME">obj.ypos</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">obj.height</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">obj.height</span><span class="PUNC">/</span><span class="NUMB">2</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>346</span> </span><span class="WHIT">    </span><span class="NAME">window.scrollBy</span><span class="PUNC">(</span><span class="NAME">xto</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">off.x</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">yto</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">off.y</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>347</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>348</span> </span><span class="WHIT">  </span><span class="COMM">/**
<span class='line'>349</span>    * Creates an XML/HTTP request to provide async communication with the server.
<span class='line'>350</span>    * @return {object} XHR object
<span class='line'>351</span>    * @autor Peter-Paul Koch (quirksMode.org)
<span class='line'>352</span>    */</span><span class="WHIT">
<span class='line'>353</span> </span><span class="WHIT">  </span><span class="NAME">createXMLHTTPObject</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'>354</span> </span><span class="WHIT">  </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>355</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">xmlhttp</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>356</span> </span><span class="WHIT">    </span><span class="COMM">// current AJAX flavours</span><span class="WHIT">
<span class='line'>357</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">XMLHttpFactories</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="WHIT">
<span class='line'>358</span> </span><span class="WHIT">      </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">XMLHttpRequest</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>359</span> </span><span class="WHIT">      </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">ActiveXObject</span><span class="PUNC">(</span><span class="STRN">"Msxml2.XMLHTTP"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>360</span> </span><span class="WHIT">      </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">ActiveXObject</span><span class="PUNC">(</span><span class="STRN">"Msxml3.XMLHTTP"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>361</span> </span><span class="WHIT">      </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">ActiveXObject</span><span class="PUNC">(</span><span class="STRN">"Microsoft.XMLHTTP"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>362</span> </span><span class="WHIT">    </span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>363</span> </span><span class="WHIT">    </span><span class="COMM">// check AJAX flavour</span><span class="WHIT">
<span class='line'>364</span> </span><span class="WHIT">    </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">XMLHttpFactories.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">++</span><span class="NAME">i</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>365</span> </span><span class="WHIT">      </span><span class="KEYW">try</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>366</span> </span><span class="WHIT">        </span><span class="NAME">xmlhttp</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">XMLHttpFactories</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>367</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">catch</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="KEYW">continue</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>368</span> </span><span class="WHIT">      </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>369</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>370</span> </span><span class="WHIT">      </span><span class="WHIT">
<span class='line'>371</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">xmlhttp</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>372</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>373</span> </span><span class="WHIT">  </span><span class="COMM">/** 
<span class='line'>374</span>    * Makes an asynchronous XMLHTTP request (XHR) via GET or POST.
<span class='line'>375</span>    * Inspired on Peter-Paul Koch's XMLHttpRequest function.   
<span class='line'>376</span>    * @return void
<span class='line'>377</span>    * @param  {object}    reqSetup   Request properties
<span class='line'>378</span>    * @config {string}    url        Request URL
<span class='line'>379</span>    * @config {function} [callback]  Response function
<span class='line'>380</span>    * @config {string}   [postdata]  POST vars in the form "var1=name&var2=name..."
<span class='line'>381</span>    * @config {object}   [xmlhttp]   A previous XMLHTTP object can be reused        
<span class='line'>382</span>    */</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'>383</span> </span><span class="WHIT">  </span><span class="NAME">sendAjaxRequest</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">setup</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>384</span> </span><span class="WHIT">  </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>385</span> </span><span class="WHIT">    </span><span class="COMM">// create XHR object (or reuse it)</span><span class="WHIT">
<span class='line'>386</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">request</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">setup.xmlhttp</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">setup.xmlhttp</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.createXMLHTTPObject</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>387</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">request</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>388</span> </span><span class="WHIT">    </span><span class="WHIT">
<span class='line'>389</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">method</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">setup.postdata</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="STRN">"POST"</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"GET"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>390</span> </span><span class="WHIT">    </span><span class="COMM">// start request</span><span class="WHIT">
<span class='line'>391</span> </span><span class="WHIT">    </span><span class="NAME">request.open</span><span class="PUNC">(</span><span class="NAME">method</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">setup.url</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>392</span> </span><span class="WHIT">    </span><span class="COMM">// post requests must set the correct content type</span><span class="WHIT">
<span class='line'>393</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">setup.postdata</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>394</span> </span><span class="WHIT">      </span><span class="NAME">request.setRequestHeader</span><span class="PUNC">(</span><span class="STRN">'Content-Type'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"application/x-www-form-urlencoded"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>395</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>396</span> </span><span class="WHIT">    </span><span class="COMM">// check for the 'complete' request state</span><span class="WHIT">
<span class='line'>397</span> </span><span class="WHIT">    </span><span class="NAME">request.onreadystatechange</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>398</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.readyState</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NUMB">4</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">setup.callback</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">'function'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>399</span> </span><span class="WHIT">        </span><span class="COMM">// send server response to callback function</span><span class="WHIT">
<span class='line'>400</span> </span><span class="WHIT">        </span><span class="NAME">setup.callback</span><span class="PUNC">(</span><span class="NAME">request.responseText</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>401</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>402</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>403</span> </span><span class="WHIT">    </span><span class="COMM">// send request</span><span class="WHIT">
<span class='line'>404</span> </span><span class="WHIT">    </span><span class="NAME">request.send</span><span class="PUNC">(</span><span class="NAME">setup.postdata</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>405</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>406</span> </span><span class="WHIT">  </span><span class="COMM">/** 
<span class='line'>407</span>    * Browser detection object. This function is used only for browser stats.
<span class='line'>408</span>    * As its autor said:
<span class='line'>409</span>    * "The more this script is used, the less likely it is to stay current.
<span class='line'>410</span>    * In order to keep this script up-to-date you should use it as little as possible."
<span class='line'>411</span>    * @autor Peter-Paul Koch (quirksMode.org)   
<span class='line'>412</span>    * @deprecated      
<span class='line'>413</span>    */</span><span class="WHIT">
<span class='line'>414</span> </span><span class="WHIT">  </span><span class="NAME">browserDetect</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>415</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>416</span>      * Launches the browser detect script.
<span class='line'>417</span>      * @return void
<span class='line'>418</span>      */</span><span class="WHIT">
<span class='line'>419</span> </span><span class="WHIT">  	</span><span class="NAME">init</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'>420</span> </span><span class="WHIT">    </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>421</span> </span><span class="WHIT">  		</span><span class="NAME">this.browser</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.searchString</span><span class="PUNC">(</span><span class="NAME">this.dataBrowser</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="STRN">"Other"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>422</span> </span><span class="WHIT">  		</span><span class="NAME">this.version</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.searchVersion</span><span class="PUNC">(</span><span class="NAME">navigator.userAgent</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">this.searchVersion</span><span class="PUNC">(</span><span class="NAME">navigator.appVersion</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="STRN">"0"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>423</span> </span><span class="WHIT">  		</span><span class="NAME">this.OS</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.searchString</span><span class="PUNC">(</span><span class="NAME">this.dataOS</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="STRN">"Other"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>424</span> </span><span class="WHIT">  	</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>425</span> </span><span class="WHIT">  	</span><span class="COMM">/**
<span class='line'>426</span>      * Performs an identity search on provided data object.
<span class='line'>427</span>      * @return {string}       browser identity     
<span class='line'>428</span>      * @param {object} data   dataBrowser identity
<span class='line'>429</span>      */</span><span class="WHIT">
<span class='line'>430</span> </span><span class="WHIT">  	</span><span class="NAME">searchString</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">data</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'>431</span> </span><span class="WHIT">    </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>432</span> </span><span class="WHIT">  		</span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">data.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">++</span><span class="NAME">i</span><span class="PUNC">)</span><span class="WHIT">	</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>433</span> </span><span class="WHIT">  			</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">dataString</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">data</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">string</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>434</span> </span><span class="WHIT">  			</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">dataProp</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">data</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">prop</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>435</span> </span><span class="WHIT">  			</span><span class="NAME">this.versionSearchString</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">data</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">versionSearch</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">data</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">identity</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>436</span> </span><span class="WHIT">  			</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">dataString</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>437</span> </span><span class="WHIT">  				</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">dataString.indexOf</span><span class="PUNC">(</span><span class="NAME">data</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">subString</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>438</span> </span><span class="WHIT">  				  </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">data</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">identity</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>439</span> </span><span class="WHIT">          </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>440</span> </span><span class="WHIT">  			</span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">dataProp</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>441</span> </span><span class="WHIT">          </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">data</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">identity</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>442</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>443</span> </span><span class="WHIT">  		</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>444</span> </span><span class="WHIT">  	</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>445</span> </span><span class="WHIT">  	</span><span class="COMM">/**
<span class='line'>446</span>      * Performs a version search on provided data string.
<span class='line'>447</span>      * @return {float}              browser version     
<span class='line'>448</span>      * @param {string} dataString   string to parse
<span class='line'>449</span>      */</span><span class="WHIT">
<span class='line'>450</span> </span><span class="WHIT">  	</span><span class="NAME">searchVersion</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">dataString</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'>451</span> </span><span class="WHIT">    </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>452</span> </span><span class="WHIT">  		</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">index</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">dataString.indexOf</span><span class="PUNC">(</span><span class="NAME">this.versionSearchString</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>453</span> </span><span class="WHIT">  		</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">index</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>454</span> </span><span class="WHIT">  		</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">parseFloat</span><span class="PUNC">(</span><span class="NAME">dataString.substring</span><span class="PUNC">(</span><span class="NAME">index</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">this.versionSearchString.length</span><span class="PUNC">+</span><span class="NUMB">1</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>455</span> </span><span class="WHIT">  	</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>456</span> </span><span class="WHIT">  	</span><span class="COMM">/**
<span class='line'>457</span>      * Common browsers array.
<span class='line'>458</span>      */</span><span class="WHIT">
<span class='line'>459</span> </span><span class="WHIT">  	</span><span class="NAME">dataBrowser</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'>460</span> </span><span class="WHIT">    </span><span class="PUNC">[</span><span class="WHIT">
<span class='line'>461</span> </span><span class="WHIT">  	  </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">prop</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">window.opera</span><span class="PUNC">,</span><span class="WHIT">                                 </span><span class="NAME">identity</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Opera"</span><span class="WHIT">     </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>462</span> </span><span class="WHIT">  		</span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">string</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">navigator.vendor</span><span class="PUNC">,</span><span class="WHIT">    </span><span class="NAME">subString</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Apple"</span><span class="PUNC">,</span><span class="WHIT">    </span><span class="NAME">identity</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Safari"</span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>463</span> </span><span class="WHIT">  		</span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">string</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">navigator.vendor</span><span class="PUNC">,</span><span class="WHIT">    </span><span class="NAME">subString</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"iCab"</span><span class="PUNC">,</span><span class="WHIT">     </span><span class="NAME">identity</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"iCab"</span><span class="WHIT">      </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>464</span> </span><span class="WHIT">  		</span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">string</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">navigator.vendor</span><span class="PUNC">,</span><span class="WHIT">    </span><span class="NAME">subString</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"KDE"</span><span class="PUNC">,</span><span class="WHIT">      </span><span class="NAME">identity</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Konqueror"</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>465</span> </span><span class="WHIT">  		</span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">string</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">navigator.vendor</span><span class="PUNC">,</span><span class="WHIT">    </span><span class="NAME">subString</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Camino"</span><span class="PUNC">,</span><span class="WHIT">   </span><span class="NAME">identity</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Camino"</span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>466</span> </span><span class="WHIT">  		</span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">string</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">navigator.userAgent</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">subString</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Chrome"</span><span class="PUNC">,</span><span class="WHIT">   </span><span class="NAME">identity</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Chrome"</span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>467</span> </span><span class="WHIT">  		</span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">string</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">navigator.userAgent</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">subString</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Flock"</span><span class="PUNC">,</span><span class="WHIT">    </span><span class="NAME">identity</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Flock"</span><span class="WHIT">     </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>468</span> </span><span class="WHIT">  		</span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">string</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">navigator.userAgent</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">subString</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Firefox"</span><span class="PUNC">,</span><span class="WHIT">  </span><span class="NAME">identity</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Firefox"</span><span class="WHIT">   </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>469</span> </span><span class="WHIT">  		</span><span class="PUNC">{</span><span class="WHIT">	</span><span class="NAME">string</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">navigator.userAgent</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">subString</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Netscape"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">identity</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Netscape"</span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>470</span> </span><span class="WHIT">  		</span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">string</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">navigator.userAgent</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">subString</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"OmniWeb"</span><span class="PUNC">,</span><span class="WHIT">  </span><span class="NAME">identity</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"OmniWeb"</span><span class="PUNC">,</span><span class="WHIT">   </span><span class="NAME">versionSearch</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"OmniWeb/"</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>471</span> </span><span class="WHIT">  		</span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">string</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">navigator.userAgent</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">subString</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"MSIE"</span><span class="PUNC">,</span><span class="WHIT">     </span><span class="NAME">identity</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"IExplorer"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">versionSearch</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"MSIE"</span><span class="WHIT">     </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>472</span> </span><span class="WHIT">  		</span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">string</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">navigator.userAgent</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">subString</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Gecko"</span><span class="PUNC">,</span><span class="WHIT">    </span><span class="NAME">identity</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Mozilla"</span><span class="PUNC">,</span><span class="WHIT">   </span><span class="NAME">versionSearch</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"rv"</span><span class="WHIT">       </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>473</span> </span><span class="WHIT">  		</span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">string</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">navigator.userAgent</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">subString</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Mozilla"</span><span class="PUNC">,</span><span class="WHIT">  </span><span class="NAME">identity</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Netscape"</span><span class="PUNC">,</span><span class="WHIT">  </span><span class="NAME">versionSearch</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Mozilla"</span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>474</span> </span><span class="WHIT">  	</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>475</span> </span><span class="WHIT">  	</span><span class="COMM">/**
<span class='line'>476</span>      * Common Operating Systems.
<span class='line'>477</span>      */</span><span class="WHIT">
<span class='line'>478</span> </span><span class="WHIT">  	</span><span class="NAME">dataOS</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'>479</span> </span><span class="WHIT">    </span><span class="PUNC">[</span><span class="WHIT">
<span class='line'>480</span> </span><span class="WHIT">  		</span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">string</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">navigator.platform</span><span class="PUNC">,</span><span class="WHIT">  </span><span class="NAME">subString</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Win"</span><span class="PUNC">,</span><span class="WHIT">      </span><span class="NAME">identity</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Windows"</span><span class="WHIT">     </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>481</span> </span><span class="WHIT">  		</span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">string</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">navigator.platform</span><span class="PUNC">,</span><span class="WHIT">  </span><span class="NAME">subString</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Mac"</span><span class="PUNC">,</span><span class="WHIT">      </span><span class="NAME">identity</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Mac"</span><span class="WHIT">         </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>482</span> </span><span class="WHIT">  		</span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">string</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">navigator.platform</span><span class="PUNC">,</span><span class="WHIT">  </span><span class="NAME">subString</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Linux"</span><span class="PUNC">,</span><span class="WHIT">    </span><span class="NAME">identity</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Linux"</span><span class="WHIT">       </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>483</span> </span><span class="WHIT">  		</span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">string</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">navigator.userAgent</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">subString</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"iPhone"</span><span class="PUNC">,</span><span class="WHIT">   </span><span class="NAME">identity</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"iPhone/iPod"</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>484</span> </span><span class="WHIT">  		</span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">string</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">navigator.userAgent</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">subString</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Chrome"</span><span class="PUNC">,</span><span class="WHIT">   </span><span class="NAME">identity</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"ChromeOS"</span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'>485</span> </span><span class="WHIT">  	</span><span class="PUNC">]</span><span class="WHIT">
<span class='line'>486</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>487</span> </span><span class="WHIT">  </span><span class="COMM">/** 
<span class='line'>488</span>    * Cookies management object.
<span class='line'>489</span>    * This cookies object allows you to store and retrieve cookies easily.
<span class='line'>490</span>    * Cookies can be picked up by any other web pages in the correct domain. 
<span class='line'>491</span>    * Cookies are set to expire after a certain length of time.
<span class='line'>492</span>    */</span><span class="WHIT">
<span class='line'>493</span> </span><span class="WHIT">  </span><span class="NAME">cookies</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>494</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>495</span>      * Stores a cookie variable.
<span class='line'>496</span>      * @return void     
<span class='line'>497</span>      * @param {string} name
<span class='line'>498</span>      * @param {mixed}  value 
<span class='line'>499</span>      * @param {string} expiredays (optional) default: no expire
<span class='line'>500</span>      * @param {string} domainpath (optional) default: root domain
<span class='line'>501</span>      */</span><span class="WHIT">
<span class='line'>502</span> </span><span class="WHIT">    </span><span class="NAME">setCookie</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">name</span><span class="PUNC">,</span><span class="NAME">value</span><span class="PUNC">,</span><span class="NAME">expiredays</span><span class="PUNC">,</span><span class="NAME">domainpath</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'>503</span> </span><span class="WHIT">    </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>504</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">path</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">domainpath</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="STRN">"/"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>505</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">expires</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">""</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>506</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">expiredays</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>507</span> </span><span class="WHIT">    		</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">date</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Date</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>508</span> </span><span class="WHIT">    		</span><span class="NAME">date.setTime</span><span class="PUNC">(</span><span class="NAME">date.getTime</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">expiredays</span><span class="PUNC">*</span><span class="NUMB">24</span><span class="PUNC">*</span><span class="NUMB">60</span><span class="PUNC">*</span><span class="NUMB">60</span><span class="PUNC">*</span><span class="NUMB">1000</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">// ms</span><span class="WHIT">
<span class='line'>509</span> </span><span class="WHIT">    		</span><span class="NAME">expires</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"; expires="</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">date.toGMTString</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>510</span> </span><span class="WHIT">    	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>511</span> </span><span class="WHIT">      </span><span class="NAME">document.cookie</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">name</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="STRN">"="</span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">escape</span><span class="PUNC">(</span><span class="NAME">value</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">expires</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="STRN">"; path="</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">path</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>512</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>513</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>514</span>      * Retrieves a cookie variable.
<span class='line'>515</span>      * @return {string}       cookie value, or false on failure     
<span class='line'>516</span>      * @param {string} name   cookie name
<span class='line'>517</span>      */</span><span class="WHIT">
<span class='line'>518</span> </span><span class="WHIT">    </span><span class="NAME">getCookie</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">name</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'>519</span> </span><span class="WHIT">    </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>520</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">cStart</span><span class="PUNC">,</span><span class="NAME">cEnd</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>521</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">document.cookie.length</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>522</span> </span><span class="WHIT">        </span><span class="NAME">cStart</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">document.cookie.indexOf</span><span class="PUNC">(</span><span class="NAME">name</span><span class="PUNC">+</span><span class="STRN">"="</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>523</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">cStart</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>524</span> </span><span class="WHIT">          </span><span class="NAME">cStart</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">cStart</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">name.length</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'>525</span> </span><span class="WHIT">          </span><span class="NAME">cEnd</span><span class="WHIT">   </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">document.cookie.indexOf</span><span class="PUNC">(</span><span class="STRN">";"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">cStart</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>526</span> </span><span class="WHIT">          </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">cEnd</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>527</span> </span><span class="WHIT">            </span><span class="NAME">cEnd</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">document.cookie.length</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>528</span> </span><span class="WHIT">          </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>529</span> </span><span class="WHIT">          </span><span class="WHIT">
<span class='line'>530</span> </span><span class="WHIT">          </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">unescape</span><span class="PUNC">(</span><span class="NAME">document.cookie.substring</span><span class="PUNC">(</span><span class="NAME">cStart</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">cEnd</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>531</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>532</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>533</span> </span><span class="WHIT">      </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>534</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>535</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>536</span>      * Checks if a cookie exists.
<span class='line'>537</span>      * @return {boolean}       true on success, or false on failure
<span class='line'>538</span>      * @param {string}  name   cookie name    
<span class='line'>539</span>      */</span><span class="WHIT">
<span class='line'>540</span> </span><span class="WHIT">    </span><span class="NAME">checkCookie</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">name</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'>541</span> </span><span class="WHIT">    </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>542</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">c</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.getCookie</span><span class="PUNC">(</span><span class="NAME">name</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>543</span> </span><span class="WHIT">      </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">c</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>544</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>545</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>546</span> </span><span class="WHIT">  </span><span class="COMM">/** 
<span class='line'>547</span>    * Core for tracking widgets.
<span class='line'>548</span>    * The word "widget" stands for *any* HTML DOM element on the page.
<span class='line'>549</span>    * This snippet was developed years ago as 'DOM4CSS', and now lives in harmony with (smt).    
<span class='line'>550</span>    */</span><span class="WHIT">
<span class='line'>551</span> </span><span class="WHIT">  </span><span class="NAME">widget</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>552</span> </span><span class="WHIT">    </span><span class="COMM">/** 
<span class='line'>553</span>      * Finds the first available element with an ID.
<span class='line'>554</span>      * Traversing count starts from current element to node parents.
<span class='line'>555</span>      * This function should be registered on mouse move/down events.   
<span class='line'>556</span>      * @return {object}            DOM node element
<span class='line'>557</span>      * @param {object}   e         DOM event
<span class='line'>558</span>      * @param {function} callback  response function             
<span class='line'>559</span>      */</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'>560</span> </span><span class="WHIT">    </span><span class="NAME">findDOMElement</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">,</span><span class="NAME">callback</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'>561</span> </span><span class="WHIT">    </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>562</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">e</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">e</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">window.event</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>563</span> </span><span class="WHIT">      </span><span class="COMM">// find the element</span><span class="WHIT">
<span class='line'>564</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">t</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">e.target</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">e.srcElement</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>565</span> </span><span class="WHIT">      </span><span class="COMM">// defeat Safari bug</span><span class="WHIT">
<span class='line'>566</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">t.nodeType</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NUMB">3</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">t</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">t.parentNode</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>567</span> </span><span class="WHIT">      </span><span class="COMM">// if the element has no ID, travese the DOM in reverse (find its parents)</span><span class="WHIT">
<span class='line'>568</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">check</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">t.id</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">this.getID</span><span class="PUNC">(</span><span class="NAME">t</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.getParents</span><span class="PUNC">(</span><span class="NAME">t</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>569</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">check</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>570</span> </span><span class="WHIT">        </span><span class="NAME">callback</span><span class="PUNC">(</span><span class="NAME">check</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>571</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>572</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>573</span> </span><span class="WHIT">    </span><span class="COMM">/** 
<span class='line'>574</span>      * Gets the element's id.
<span class='line'>575</span>      * @return {string}     DOM node ID
<span class='line'>576</span>      * @param {object}  o   DOM node element        
<span class='line'>577</span>      */</span><span class="WHIT">
<span class='line'>578</span> </span><span class="WHIT">    </span><span class="NAME">getID</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">o</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'>579</span> </span><span class="WHIT">    </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>580</span> </span><span class="WHIT">      </span><span class="COMM">// do not track HTML and BODY nodes</span><span class="WHIT">
<span class='line'>581</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">o.nodeName</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'HTML'</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">o.nodeName</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'BODY'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>582</span> </span><span class="WHIT">      </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">o.nodeName</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"#"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">o.id</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>583</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>584</span> </span><span class="WHIT">    </span><span class="COMM">/** 
<span class='line'>585</span>      * Gets the element's class. 
<span class='line'>586</span>      * If that element has more than one CSS class, return only the first class name found.
<span class='line'>587</span>      * @return {string}     DOM node class
<span class='line'>588</span>      * @param {object}  o   DOM node element        
<span class='line'>589</span>      */</span><span class="WHIT">  </span><span class="WHIT">
<span class='line'>590</span> </span><span class="WHIT">    </span><span class="NAME">getClass</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">o</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'>591</span> </span><span class="WHIT">    </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>592</span> </span><span class="WHIT">      </span><span class="COMM">// do not track HTML and BODY nodes</span><span class="WHIT">
<span class='line'>593</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">o.nodeName</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'HTML'</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">o.nodeName</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'BODY'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>594</span> </span><span class="WHIT">      </span><span class="COMM">// if the element has no class, return its node name only</span><span class="WHIT">
<span class='line'>595</span> </span><span class="WHIT">      </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">o.className</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">o.nodeName</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"."</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">o.className.split</span><span class="PUNC">(</span><span class="STRN">" "</span><span class="PUNC">)</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">o.nodeName</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>596</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>597</span> </span><span class="WHIT">    </span><span class="COMM">/** 
<span class='line'>598</span>      * Gets all node parents until a node with ID is found.
<span class='line'>599</span>      * @return {string}     CSS selector string (intended to use in other scripts).
<span class='line'>600</span>      * @param {object}  o   DOM node element        
<span class='line'>601</span>      */</span><span class="WHIT">   </span><span class="WHIT">
<span class='line'>602</span> </span><span class="WHIT">    </span><span class="NAME">getParents</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">o</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'>603</span> </span><span class="WHIT">    </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>604</span> </span><span class="WHIT">      </span><span class="COMM">// store current node first</span><span class="WHIT">
<span class='line'>605</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">elem</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">o.id</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">this.getID</span><span class="PUNC">(</span><span class="NAME">o</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.getClass</span><span class="PUNC">(</span><span class="NAME">o</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>606</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">list</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NAME">elem</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">//(elem) ? [elem] : [];</span><span class="WHIT">
<span class='line'>607</span> </span><span class="WHIT">      </span><span class="COMM">// get all parents until find an element with ID</span><span class="WHIT">
<span class='line'>608</span> </span><span class="WHIT">      </span><span class="KEYW">while</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">o.parentNode</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>609</span> </span><span class="WHIT">        </span><span class="NAME">o</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">o.parentNode</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>610</span> </span><span class="WHIT">        </span><span class="COMM">// store only element nodes</span><span class="WHIT">
<span class='line'>611</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">o.nodeType</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>612</span> </span><span class="WHIT">          </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">o.id</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>613</span> </span><span class="WHIT">            </span><span class="NAME">elem</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.getID</span><span class="PUNC">(</span><span class="NAME">o</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>614</span> </span><span class="WHIT">            </span><span class="NAME">list.unshift</span><span class="PUNC">(</span><span class="NAME">elem</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>615</span> </span><span class="WHIT">            </span><span class="COMM">// if parent has an ID, end finding</span><span class="WHIT">
<span class='line'>616</span> </span><span class="WHIT">            </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">list.join</span><span class="PUNC">(</span><span class="STRN">" "</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>617</span> </span><span class="WHIT">          </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>618</span> </span><span class="WHIT">            </span><span class="NAME">elem</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.getClass</span><span class="PUNC">(</span><span class="NAME">o</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>619</span> </span><span class="WHIT">            </span><span class="NAME">list.unshift</span><span class="PUNC">(</span><span class="NAME">elem</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>620</span> </span><span class="WHIT">          </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'>621</span> </span><span class="WHIT">          </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">o</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">parent</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>622</span> </span><span class="WHIT">            </span><span class="COMM">// #document reached</span><span class="WHIT">
<span class='line'>623</span> </span><span class="WHIT">            </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">list.join</span><span class="PUNC">(</span><span class="STRN">" "</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>624</span> </span><span class="WHIT">          </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>625</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>626</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>627</span> </span><span class="WHIT">      </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">list.join</span><span class="PUNC">(</span><span class="STRN">" "</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>628</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>629</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>630</span> </span><span class="WHIT">  </span><span class="COMM">/**
<span class='line'>631</span>    * Array methods -- without extending the Array prototype (best practice). 
<span class='line'>632</span>    * Note: These Array methods would only work for a completely 'dense' array. 
<span class='line'>633</span>    * If you're working with sparse arrays, then you should pre-process them:
<span class='line'>634</span>    * &lt;code> 
<span class='line'>635</span>    *   var narray = [];
<span class='line'>636</span>    *   for (var i = 0; i &lt; array.length; ++i) {
<span class='line'>637</span>    *     if (array[i] != null) { narray.push(array[i]); }
<span class='line'>638</span>    *   }
<span class='line'>639</span>    *   // now narray is converted in a 'dense' array
<span class='line'>640</span>    * &lt;/code>   
<span class='line'>641</span>    */</span><span class="WHIT">
<span class='line'>642</span> </span><span class="WHIT">  </span><span class="NAME">array</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>643</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>644</span>      * Gets the max element in a numeric array. 
<span class='line'>645</span>      * @return {float}        array max value
<span class='line'>646</span>      * @param {array} array 
<span class='line'>647</span>      * @author John Resig
<span class='line'>648</span>      */</span><span class="WHIT">
<span class='line'>649</span> </span><span class="WHIT">    </span><span class="NAME">max</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">array</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'>650</span> </span><span class="WHIT">    </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>651</span> </span><span class="WHIT">      </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">Math.max.apply</span><span class="PUNC">(</span><span class="NAME">Math</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">array</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>652</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>653</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>654</span>      * Gets the min element in a numeric array.
<span class='line'>655</span>      * @return {float}        array min value
<span class='line'>656</span>      * @param {array} array 
<span class='line'>657</span>      * @author John Resig
<span class='line'>658</span>      */</span><span class="WHIT">
<span class='line'>659</span> </span><span class="WHIT">    </span><span class="NAME">min</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">array</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'>660</span> </span><span class="WHIT">    </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>661</span> </span><span class="WHIT">      </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">Math.max.apply</span><span class="PUNC">(</span><span class="NAME">Math</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">array</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>662</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>663</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>664</span>      * Sums all elements in a numeric array.
<span class='line'>665</span>      * @return {float}        array sum
<span class='line'>666</span>      * @param {array} array   
<span class='line'>667</span>      */</span><span class="WHIT">
<span class='line'>668</span> </span><span class="WHIT">    </span><span class="NAME">sum</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">array</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'>669</span> </span><span class="WHIT">    </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>670</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">s</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>671</span> </span><span class="WHIT">      </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">l</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">array.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">l</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">++</span><span class="NAME">i</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>672</span> </span><span class="WHIT">        </span><span class="NAME">s</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">array</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>673</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>674</span> </span><span class="WHIT">      </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">s</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'>675</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>676</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>677</span>      * Appends any supplied arguments to the end of the array, in the order given.
<span class='line'>678</span>      * @return {integer}        new length of the array
<span class='line'>679</span>      * @param {array} array
<span class='line'>680</span>      * @param {mixed} content   anything to push to array  
<span class='line'>681</span>      * @author Ash Searle (tweaked by Luis Leiva)
<span class='line'>682</span>      * @link http://hexmen.com/blog/ 
<span class='line'>683</span>      * @license http://creativecommons.org/licenses/by/2.5/
<span class='line'>684</span>      */</span><span class="WHIT">
<span class='line'>685</span> </span><span class="WHIT">    </span><span class="NAME">push</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">array</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">content</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'>686</span> </span><span class="WHIT">    </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>687</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">args</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Array.prototype.slice.call</span><span class="PUNC">(</span><span class="NAME">content</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>688</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">n</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">array.length</span><span class="WHIT"> </span><span class="PUNC">>>></span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>689</span> </span><span class="WHIT">      </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">args.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">++</span><span class="NAME">i</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>690</span> </span><span class="WHIT">    	 </span><span class="NAME">array</span><span class="PUNC">[</span><span class="NAME">n</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">args</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>691</span> </span><span class="WHIT">    	 </span><span class="NAME">n</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">n</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="WHIT"> </span><span class="PUNC">>>></span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>692</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>693</span> </span><span class="WHIT">      </span><span class="NAME">array.length</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">n</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>694</span> </span><span class="WHIT">      </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">n</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>695</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>696</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>697</span>      * Removes the last element of the array and returns it.
<span class='line'>698</span>      * @return {mixed}        element removed (if any). Otherwise return &lt;code>undefined&lt;/code>
<span class='line'>699</span>      * @param {array} array 
<span class='line'>700</span>      * @author Ash Searle
<span class='line'>701</span>      * @link http://hexmen.com/blog/ 
<span class='line'>702</span>      * @license http://creativecommons.org/licenses/by/2.5/
<span class='line'>703</span>      */</span><span class="WHIT">
<span class='line'>704</span> </span><span class="WHIT">    </span><span class="NAME">pop</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">array</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'>705</span> </span><span class="WHIT">    </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>706</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">n</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">array.length</span><span class="WHIT"> </span><span class="PUNC">>>></span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>707</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">n</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>708</span> </span><span class="WHIT">      	</span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">array</span><span class="PUNC">[</span><span class="PUNC">--</span><span class="NAME">n</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>709</span> </span><span class="WHIT">      	</span><span class="KEYW">delete</span><span class="WHIT"> </span><span class="NAME">array</span><span class="PUNC">[</span><span class="NAME">n</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>710</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>711</span> </span><span class="WHIT">      </span><span class="NAME">array.length</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">n</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>712</span> </span><span class="WHIT">      </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>713</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>714</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>715</span>      * Removes element(s) in desired position(s) from input array and returns the modified array.
<span class='line'>716</span>      * @return {array}          modified array
<span class='line'>717</span>      * @param {array}   array
<span class='line'>718</span>      * @param {integer} from    start index
<span class='line'>719</span>      * @param {integer} to      end index
<span class='line'>720</span>      * @author John Resig 
<span class='line'>721</span>      */</span><span class="WHIT">
<span class='line'>722</span> </span><span class="WHIT">    </span><span class="NAME">remove</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">array</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">from</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">to</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'>723</span> </span><span class="WHIT">    </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>724</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">rest</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">array.slice</span><span class="PUNC">(</span><span class="PUNC">(</span><span class="NAME">to</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">from</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">array.length</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>725</span> </span><span class="WHIT">      </span><span class="NAME">array.length</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">from</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">array.length</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">from</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">from</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>726</span> </span><span class="WHIT">      </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">array.push.apply</span><span class="PUNC">(</span><span class="NAME">array</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">rest</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>727</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>728</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>729</span>      * Gets the index of the first element that matches search value.
<span class='line'>730</span>      * @return {integer}          index if found, or -1 otherwise
<span class='line'>731</span>      * @param {array}   array
<span class='line'>732</span>      * @param {mixed}   search    element to search for
<span class='line'>733</span>      * @param {integer} from      start index      
<span class='line'>734</span>      * @link http://snipplr.com/view/3355/arrayindexof/   
<span class='line'>735</span>      */</span><span class="WHIT">
<span class='line'>736</span> </span><span class="WHIT">    </span><span class="NAME">indexOf</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">array</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">search</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">from</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'>737</span> </span><span class="WHIT">    </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>738</span> </span><span class="WHIT">      </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">from</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">total</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">array.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">total</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">++</span><span class="NAME">i</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>739</span> </span><span class="WHIT">        </span><span class="COMM">// strict types should use === comparison</span><span class="WHIT">
<span class='line'>740</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">array</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">search</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>741</span> </span><span class="WHIT">          </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>742</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>743</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>744</span> </span><span class="WHIT">      </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>745</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>746</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>747</span> </span><span class="WHIT">  </span><span class="WHIT">
<span class='line'>748</span> </span><span class="PUNC">}</span><span class="PUNC">;</span></pre></body></html>